from django.contrib import admin

# Register your models here.
from django.contrib import admin
from management.models import equipment, epRunning, repair, scrap, user


# 模型的管理器（自定制显示内容类）
class userAdmin(admin.ModelAdmin):
    list_display = ('id', 'password', 'type')


class equipmentAdmin(admin.ModelAdmin):
    list_display = (
        'id', 'category', 'deviceName', 'model', 'price', 'unit', 'exist', 'purchaseDate', 'manufacturer', 'purchaser', 'batch')


class epRunningAdmin(admin.ModelAdmin):
    list_display = ('id', 'place', 'belongIn', 'isActive', 'inUsing', 'eid', 'enableDate')


class repairAdmin(admin.ModelAdmin):
    list_display = ('id', 'eprid', 'uid', 'status', 'result', 'repairDate', 'repairFactory', 'cost')


class scrapAdmin(admin.ModelAdmin):
    list_display = ('id', 'eid', 'scrapDate')


# 在admin中注册绑定
admin.site.register(user, userAdmin)
admin.site.register(equipment, equipmentAdmin)
admin.site.register(epRunning, epRunningAdmin)
admin.site.register(repair, repairAdmin)
admin.site.register(scrap, scrapAdmin)
